package javacore.day10.AdapterMusic;

public class MediaAdapter implements MediaPlayer {
//	Mp4Player mp4;
//	VlcPlayer vlc;
	AdvancedMediaPlayer advancedMusicPlayer;
//	abstractors
	public MediaAdapter(String audioType) {
		if (audioType.equalsIgnoreCase("vlc")) {
			advancedMusicPlayer = new VlcPlayer();
//			vlc=new VlcPlayer();
			
		} else if (audioType.equalsIgnoreCase("mp4")) {
			advancedMusicPlayer = new Mp4Player();
//			mp4=new Mp4Player();
		}
	}

	@Override
	public void play(String audioType, String fileName) {
		// TODO Auto-generated method stub
	      if(audioType.equalsIgnoreCase("vlc")){
	          advancedMusicPlayer.playVlc(fileName);
//	    	  vlc.playVlc(fileName);
	          
	       }else if(audioType.equalsIgnoreCase("mp4")){
	          advancedMusicPlayer.playMp4(fileName);
//	    	   mp4.playMp4(fileName);
	       }

	}

}
